# Generated by Django 3.2.16 on 2022-12-05 06:32

import datetime
from django.conf import settings
import django.contrib.postgres.fields.jsonb
import django.contrib.postgres.operations
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import uuid

import main.models
import siriuso.models.postgres
import siriuso.utils.modules


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0009_alter_user_last_name_max_length'),
        ('informiloj', '0014_informilojurboj'),
    ]

    operations = [
        migrations.CreateModel(
            name='SiriusoWablono',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, verbose_name='UUID')),
                ('krea_dato', models.DateTimeField(auto_now_add=True, verbose_name='Krea dato')),
                ('forigo', models.BooleanField(blank=True, default=False, verbose_name='Forigo')),
                ('foriga_dato', models.DateTimeField(blank=True, default=None, null=True, verbose_name='Foriga dato')),
                ('a_foriga_dato', models.DateTimeField(blank=True, default=None, null=True, verbose_name='Aŭtomata foriga dato')),
                ('publikigo', models.BooleanField(default=False, verbose_name='Publikigis')),
                ('publikiga_dato', models.DateTimeField(blank=True, default=None, null=True, verbose_name='Dato de publikigo')),
                ('arkivo', models.BooleanField(default=False, verbose_name='Arkiva')),
                ('arkiva_dato', models.DateTimeField(blank=True, default=None, null=True, verbose_name='Arkiva dato')),
                ('lasta_dato', models.DateTimeField(blank=True, null=True, verbose_name='Dato de lasta modifo')),
                ('nomo', models.JSONField(blank=True, default=siriuso.utils.modules.default_lingvo, encoder=siriuso.models.postgres.CallableEncoder, verbose_name='Titolo')),
                ('priskribo', models.JSONField(blank=True, default=siriuso.utils.modules.default_lingvo, encoder=siriuso.models.postgres.CallableEncoder, verbose_name='Priskribo')),
            ],
            options={
                'verbose_name': 'Ĝenerala ŝablono',
                'verbose_name_plural': 'Ĝenerala ŝablonoj',
                'db_table': 'wablono',
                'permissions': (('povas_vidi_realecan_wablonon', 'Povas vidi realecan wablonon'), ('povas_krei_realecan_wablonon', 'Povas krei realecan wablonon'), ('povas_forigi_realecan_wablonon', 'Povas forigi realecan wablonon'), ('povas_arkivi_realecan_wablonon', 'Povas arkivi realecan wablonon'), ('povas_shanghi_realecan_wablonon', 'Povas ŝanĝi realecan wablonon')),
            },
        ),
        migrations.CreateModel(
            name='UzantoTipo',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, verbose_name='UUID')),
                ('krea_dato', models.DateTimeField(auto_now_add=True, verbose_name='Krea dato')),
                ('forigo', models.BooleanField(blank=True, default=False, verbose_name='Forigo')),
                ('foriga_dato', models.DateTimeField(blank=True, default=None, null=True, verbose_name='Foriga dato')),
                ('a_foriga_dato', models.DateTimeField(blank=True, default=None, null=True, verbose_name='Aŭtomata foriga dato')),
                ('publikigo', models.BooleanField(default=False, verbose_name='Publikigis')),
                ('publikiga_dato', models.DateTimeField(blank=True, default=None, null=True, verbose_name='Dato de publikigo')),
                ('arkivo', models.BooleanField(default=False, verbose_name='Arkiva')),
                ('arkiva_dato', models.DateTimeField(blank=True, default=None, null=True, verbose_name='Arkiva dato')),
                ('kodo', models.CharField(max_length=16, verbose_name='Kodo')),
                ('speciala', models.BooleanField(default=False, verbose_name='Speciala')),
                ('nomo', models.JSONField(blank=True, default=siriuso.utils.modules.default_lingvo, encoder=siriuso.models.postgres.CallableEncoder, null=True, verbose_name='Nomo')),
                ('wablomo', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='main_uzantotipo_wablomo', to='main.siriusowablono', verbose_name='Ĝenerala ŝablono')),
            ],
            options={
                'verbose_name': 'Uzanto tipo',
                'verbose_name_plural': 'Uzantoj tipoj',
                'db_table': 'uzantoj_tipoj',
            },
        ),
        migrations.CreateModel(
            name='Uzanto',
            fields=[
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('id', models.AutoField(editable=False, primary_key=True, serialize=False, verbose_name='ID')),
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True, verbose_name='UUID')),
                ('sekso', models.CharField(blank=True, choices=[('vira', 'Vira'), ('virina', 'Virina')], max_length=6, null=True, verbose_name='Sekso')),
                ('chefa_retposhto', models.EmailField(max_length=254, unique=True, verbose_name='Retpoŝto')),
                ('password', models.CharField(max_length=500, verbose_name='Pasvorto')),
                ('chefa_telefonanumero', models.CharField(blank=True, db_index=True, max_length=18, null=True, verbose_name='Telefonanumero')),
                ('naskighdato', models.DateField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(datetime.date(1900, 1, 1)), main.models.maks_naskighdato_validator], verbose_name='Naskiĝdato')),
                ('is_active', models.BooleanField(default=False)),
                ('is_admin', models.BooleanField(default=False)),
                ('konfirmita', models.BooleanField(default=False, verbose_name='Statuso de konfirmo')),
                ('konfirmita_hash', models.CharField(blank=True, max_length=256, null=True)),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('loghlando', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='main_uzanto_loghlando', to='informiloj.informilojlando', verbose_name='Loĝlando')),
                ('loghloko', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='main_uzanto_loghloko', to='informiloj.informilojloko', verbose_name='Loĝloko')),
                ('loghregiono', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='main_uzanto_loghregiono', to='informiloj.informilojregiono', verbose_name='Loĝregiono')),
                ('marital_status', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='main_uzanto_marital_status', to='informiloj.informilojfamiliastato', verbose_name='Familia stato')),
                ('naskighlando', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='main_uzanto_naskighlando', to='informiloj.informilojlando', verbose_name='Naskiĝlando')),
                ('naskighloko', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='main_uzanto_naskighloko', to='informiloj.informilojloko', verbose_name='Naskiĝloko')),
                ('naskighregiono', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='main_uzanto_naskighregiono', to='informiloj.informilojregiono', verbose_name='Naskiĝregiono')),
                ('posedanto', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='main_uzanto_posedanto', to=settings.AUTH_USER_MODEL, verbose_name='Posedanto')),
                ('tipo', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='main_uzanto_tipo', to='main.uzantotipo', verbose_name='Tipo')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
                ('krea_dato', models.DateTimeField(auto_now_add=True, null=True, verbose_name='Krea dato')),
                ('chefa_lingvo', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='main_uzanto_chefa_lingvo', to='informiloj.informilojlingvo', verbose_name='Lingvo')),
                ('malbona_retposhto', models.BooleanField(default=False, verbose_name='Malbona retpoŝta adreso')),
                ('agordoj', models.JSONField(blank=True, default=main.models.uzaj_agordoj, encoder=siriuso.models.postgres.CallableEncoder, null=True, verbose_name='Uzaj agordoj')),
                ('dua_nomo', models.JSONField(blank=True, default=siriuso.utils.modules.default_lingvo, encoder=siriuso.models.postgres.CallableEncoder, null=True, verbose_name='Dua nomo')),
                ('familinomo', models.JSONField(blank=True, default=siriuso.utils.modules.default_lingvo, encoder=siriuso.models.postgres.CallableEncoder, null=True, verbose_name='Familinomo')),
                ('unua_nomo', models.JSONField(blank=True, default=siriuso.utils.modules.default_lingvo, encoder=siriuso.models.postgres.CallableEncoder, null=True, verbose_name='Unua nomo')),
            ],
            options={
                'verbose_name': 'Uzanto',
                'verbose_name_plural': 'Uzantoj',
                'db_table': 'uzantoj',
                'permissions': (('povas_vidi_uzanton', 'Povas vidi uzanton'),
                                ('povas_krei_uzanton', 'Povas krei uzanton'),
                                ('povas_forigi_uzanton', 'Povas forigu uzanton'),
                                ('povas_shanghi_uzantan_avataron', 'Povas ŝanĝi uzantan avataron'),
                                ('povas_shanghi_uzantan_kovrilon', 'Povas ŝanĝi uzantan kovrilon'),
                                ('povas_shanghi_uzantan_nomon', 'Povas ŝanĝi uzantan nomon'),
                                ('povas_shanghi_uzantan_statuson', 'Povas ŝanĝi uzantan statuson'),
                                ('povas_shanghi_uzantan_realecon', 'Povas ŝanĝi uzantan realecon')),
            },
        ),
        migrations.CreateModel(
            name='UzantaShlosilo',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, verbose_name='UUID')),
                ('starta_dato', models.DateTimeField(auto_now_add=True, verbose_name='Starta dato')),
                ('fina_dato', models.DateTimeField(blank=True, null=True, verbose_name='Fina dato')),
                ('shlosilo', models.CharField(max_length=128, unique=True, verbose_name='Shlosilo')),
                ('kunteksto', models.CharField(blank=True, max_length=128, null=True, verbose_name='Kunteksto')),
                ('uzanto', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='main_uzantashlosilo_uzanto', to=settings.AUTH_USER_MODEL, verbose_name='Uzanto')),
            ],
            options={
                'verbose_name': 'Uzanta shlosilo',
                'verbose_name_plural': 'Uzantaj shlosiloj',
                'db_table': 'uzanta_slosilo',
            },
        ),
        migrations.CreateModel(
            name='SiriusoSlugo',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, verbose_name='UUID')),
                ('krea_dato', models.DateTimeField(auto_now_add=True, verbose_name='Krea dato')),
                ('forigo', models.BooleanField(blank=True, default=False, verbose_name='Forigo')),
                ('foriga_dato', models.DateTimeField(blank=True, default=None, null=True, verbose_name='Foriga dato')),
                ('a_foriga_dato', models.DateTimeField(blank=True, default=None, null=True, verbose_name='Aŭtomata foriga dato')),
                ('publikigo', models.BooleanField(default=False, verbose_name='Publikigis')),
                ('publikiga_dato', models.DateTimeField(blank=True, default=None, null=True, verbose_name='Dato de publikigo')),
                ('arkivo', models.BooleanField(default=False, verbose_name='Arkiva')),
                ('arkiva_dato', models.DateTimeField(blank=True, default=None, null=True, verbose_name='Arkiva dato')),
                ('slugo', models.SlugField(default=None, max_length=32, unique=True, verbose_name='Slugo')),
                ('wablomo', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='main_siriusoslugo_wablomo', to='main.siriusowablono', verbose_name='Ĝenerala ŝablono')),
            ],
            options={
                'verbose_name': 'Slugo',
                'verbose_name_plural': 'Slugoj',
                'db_table': 'siriuso_slugoj',
            },
        ),
        migrations.CreateModel(
            name='SpecialajGrupoj',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, verbose_name='UUID')),
                ('kodo', models.CharField(db_index=True, max_length=64, verbose_name='Kodo')),
                ('nomo', models.JSONField(blank=True, default=siriuso.utils.modules.default_lingvo, encoder=siriuso.models.postgres.CallableEncoder, null=True, verbose_name='Unua nomo')),
                ('grupoj', models.ManyToManyField(to='auth.Group', verbose_name='Grupoj de rajtoj')),
            ],
            options={
                'verbose_name': 'Speciala grupo',
                'verbose_name_plural': 'Specialaj grupoj',
                'db_table': 'specialaj_grupoj',
            },
        ),
        migrations.CreateModel(
            name='SistemaPeto',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, verbose_name='UUID')),
                ('krea_dato', models.DateTimeField(auto_now_add=True, verbose_name='Krea dato')),
                ('tasko', models.CharField(max_length=1024, verbose_name='Tasko nomo')),
                ('tasko_id', models.UUIDField(blank=True, db_index=True, null=True, verbose_name='Celery ID')),
                ('komenca_dato', models.DateTimeField(blank=True, null=True, verbose_name='Komenca dato')),
                ('fina_dato', models.DateTimeField(blank=True, null=True, verbose_name='Fina dato')),
                ('parametroj', models.JSONField(verbose_name='Taskaj parametroj')),
                ('statuso', models.CharField(blank=True, default='', max_length=64, verbose_name='Statuso')),
                ('rezulto', models.JSONField(blank=True, null=True, verbose_name='Tasko rezulto')),
                ('autoro', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='main_sistemapeto_autoro', to=settings.AUTH_USER_MODEL, verbose_name='Autoro')),
            ],
            options={
                'verbose_name': 'Sitema peto',
                'verbose_name_plural': 'Sistemaj petoj',
                'db_table': 'sistemaj_petoj',
            },
        ),
        migrations.AddField(
            model_name='siriusowablono',
            name='autoro',
            field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, related_name='main_siriusowablono_autoro', to=settings.AUTH_USER_MODEL, verbose_name='Aŭtoro'),
        ),
        migrations.AddField(
            model_name='siriusowablono',
            name='lasta_autoro',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='main_siriusowablono_lasta_autoro', to=settings.AUTH_USER_MODEL, verbose_name='Modifita de'),
        ),
    ]
